gnomeos: More tweaks to install/run scripts
authorColin Walters <walters@verbum.org>
Sat, 4 Feb 2012 15:46:00 +0000 (10:46 -0500)
committerColin Walters <walters@verbum.org>
Sat, 4 Feb 2012 15:46:00 +0000 (10:46 -0500)
The run script now allows using the current kernel+initrd.

gnomeos/yocto/gnomeos-install.sh
gnomeos/yocto/gnomeos-run.sh
gnomeos/yocto/ostree-setup.sh

index 8d906e3c9517d31d93eda4d3fa058f80d3e258ed..613d9c509f2b8b599cc5e954b4eb1547b04355de 100755 (executable)
@@ -40,12 +40,21 @@ usage () {
 ARCH=i686
 BRANCH_PREFIX="gnomeos-3.4-${ARCH}-"
 
-if ! test -d /ostree; then
-    mkdir /ostree
+if ! test -d /ostree/repo/objects; then
+    mkdir -p /ostree
 
     $SRCDIR/ostree-setup.sh /ostree
 fi
 
+#ostree pull http://ostree.gnome.org/3.4/repo gnomeos-3.4-i686-{runtime,devel}
+if ! test -f /ostree/repo/refs/heads/gnomeos-3.4-i686-runtime; then
+    cat <<EOF
+You must get a repo from somewhere...e.g.:
+ cd /ostree && rsync --progress -ave ssh master.gnome.org:/home/users/walters/ostree/repo .
+EOF
+    exit 1
+fi
+
 cd /ostree
 for branch in runtime devel; do
     rev=$(ostree --repo=$(pwd)/repo rev-parse ${BRANCH_PREFIX}${branch});
@@ -60,5 +69,13 @@ rm -f current
 ln -s ${BRANCH_PREFIX}runtime-current current
 
 cp -a ./${BRANCH_PREFIX}${branch}-current/usr/sbin/ostree-init .
+cd -
 
-cp $SRCDIR/15_ostree /etc/grub.d/
+if test -d /etc/grub.d; then
+    cp $SRCDIR/15_ostree /etc/grub.d/
+else
+    cat <<EOF
+GRUB 2 not detected; you'll need to edit e.g. /boot/grub/grub.conf manually
+Kernel has been installed as /boot/bzImage-gnomeos.bin
+EOF
+fi
index b0ae93e4d4e4c6725d809ac52de186537c8b9c08..9fede71c3b59db8945cd68a72355c578d39d131c 100755 (executable)
@@ -40,6 +40,8 @@ usage () {
 OSTREE_REPO=$1
 shift
 test -n "$OSTREE_REPO" || usage
+TYPE=$1
+shift
 
 ARCH=i686
 BRANCH_PREFIX="gnomeos-3.4-${ARCH}-"
@@ -100,8 +102,12 @@ ostree --repo=${OSTREE_REPO} local-clone repo ${BRANCH_PREFIX}runtime ${BRANCH_P
 for branch in runtime devel; do
     rev=$(ostree --repo=repo rev-parse ${BRANCH_PREFIX}${branch});
     if ! test -d ${BRANCH_PREFIX}${branch}-${rev}; then
-        ostree --repo=repo checkout ${rev} ${BRANCH_PREFIX}${branch}-${rev}
-        ostbuild chroot-run-triggers ${BRANCH_PREFIX}${branch}-${rev}
+        ostree --repo=repo checkout ${rev} ${BRANCH_PREFIX}${branch}-${rev}.tmp
+        ostbuild chroot-run-triggers ${BRANCH_PREFIX}${branch}-${rev}.tmp
+        if test x$TYPE = xcurrent; then
+            cp -ar /lib/modules/`uname -r` ${BRANCH_PREFIX}${branch}-${rev}.tmp/lib/modules
+        fi
+        mv ${BRANCH_PREFIX}${branch}-${rev}{.tmp,}
     fi
     rm -f ${BRANCH_PREFIX}${branch}-current
     ln -s ${BRANCH_PREFIX}${branch}-${rev} ${BRANCH_PREFIX}${branch}-current
@@ -117,15 +123,22 @@ sync
 umount fs
 rmdir fs
 
-ARGS="$@"
+ARGS="rd.plymouth=0 $@"
 if ! echo $ARGS | grep -q 'init='; then
     ARGS="init=/ostree-init $ARGS"
 fi
-if ! echo $ARGS | grep -q 'root='; then
-    ARGS="root=/dev/hda $ARGS"
-fi
 if ! echo $ARGS | grep -q 'ostree='; then
     ARGS="ostree=${BRANCH_PREFIX}runtime-current $ARGS"
 fi
+if test x$TYPE = xqemu; then
+    ARGS="root=/dev/hda $ARGS"
+    KERNEL=./tmp-eglibc/deploy/images/bzImage-qemux86.bin
+else
+    if test x$TYPE = xcurrent; then
+        ARGS="root=/dev/sda $ARGS"
+        KERNEL=/boot/vmlinuz-`uname -r`
+        INITRD_ARG="-initrd /boot/initramfs-`uname -r`.img"
+    fi
+fi
 
-exec qemu-kvm -kernel ./tmp-eglibc/deploy/images/bzImage-qemux86.bin -hda gnomeos-fs.img -net user -net nic,model=virtio -m 512M -append "$ARGS" -monitor stdio
+exec qemu-kvm -kernel ${KERNEL} ${INITRD_ARG} -hda gnomeos-fs.img -net user -net nic,model=virtio -m 512M -append "$ARGS" -monitor stdio
index 584c3a922490f525bead8e2e57ea3a9ba908ba22..fa14d8dec8356d0a84591c6af32c6754bf81154a 100755 (executable)
@@ -52,9 +52,6 @@ chown 2:2 ./var/lib/gdm
 touch ./var/shadow
 chmod 0600 ./var/shadow
 
-mkdir repo
-ostree --repo=repo init
-
 cat >./var/passwd << EOF
 root::0:0:root:/:/bin/sh
 dbus:*:1:1:dbus:/:/bin/false
@@ -65,3 +62,6 @@ root:*:0:root
 dbus:*:1:
 gdm:*:2:
 EOF
+
+mkdir repo
+ostree --repo=repo init